#include <vector>
#include "thread.hpp"
#include <unistd.h>

using namespace ThreadModlue;

class ThreadData
{
public:
    std::string name;
    pthread_t tid;
};

void Count(ThreadData td)
{
    while(true)
    {
        std::cout << "我是一个新线程" << td.name << std::endl;
        sleep(1);
    }
}

int main()
{
    //模版式的封装
    //之前的线程只能传递void()类型的函数 现在支持void(T)类型
    ThreadData td;
    td.name = "thread-1";
    Thread<ThreadData> t(Count,td);
    t.Start();
    t.Join();

    return 0;
}
